home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BBS Toolkit
/
BBS Toolkit.iso
/
windows
/
autocs10.zip
/
AUTOCIS.WAS
< prev
next >
Wrap
Text File
|
1992-11-04
|
91KB
|
3,015 lines
;AUTOCIS.WAS - automated CIS script for Prowin
; Reduced capability script, awaiting compiler improvement
; ****************************************************************************
; * This is a script for Procomm for Windows that automates the uploadind *
; * and downloading of Mail, Forum messages and Library files. Activities *
; * in other areas of CompuServe are also automated. Task definition and *
; * message/letter writing and review is accomplished off-line without CIS *
; * charges and on-line operation is totally automated. *
; ****************************************************************************
; Last update 2 November 1992
#define Forum1 "P&ractice" ; menu descriptions
#define Forum2 "&DataStorm"
#define Forum3 "&PPI Forum"
#define Forum4 "&Compaq Forum"
#define Forum5 "&MECA"
#define Forum6 "&Norton Utilities"
#define Forum7 "&IBM Communications"
#define ForCmd1 "PRACTICE" ; GO command for Forum
#define ForCmd2 "DSTORM"
#define ForCmd3 "PPIFORUM"
#define ForCmd4 "CPQFORUM"
#define ForCmd5 "MECA"
#define ForCmd6 "NORUTL"
#define ForCmd7 "IBMCOM"
; LOCAL STRING VARIABLES used = 3
; GLOBAL STRING VARIABLES - 92 used
string Order, Order1, Order2, Order3, Order4, Order5
string Cfg1,Cfg2,Cfg3,Cfg4,Cfg5,Cfg6,Cfg7,Cfg8,Cfg9,Cfg10,Cfg0="#############"
string MailDir,FileDir,LogDir,LogName,LogLoc,TempS,WordS,Join,SaveS,Char
string Dirname,UseFile,Name,ToDay,Month,Day,UserFor,DesFile,ETime
string Mailin, MailOut, MesgIn, MesgOut, FileIn, FileOut, Title, CISTitle
String Locn1,Locn2,Locn3,Locn4,Locn5
String Area1,Area2,Area3,Area4,Area5
String Sect1,Sect2,Sect3,Sect4,Sect5
String Actn1,Actn2,Actn3,Actn4,Actn5
String Extn1,Extn2,Extn3,Extn4,Extn5
String ShoTask1,ShoTask2,ShoTask3,ShoTask4,ShoTask5
String File1,File2,File3,File4,File5,File6,File7,File8,File9,File10,FileList
String Var1,Var2,Var3,Var4,Var5,Var6 ; extra terms needed in listing
; LOCAL NUMERICAL VARIABLES used = 7 (2 are Long)
; GLOBAL NUMERICAL VARIABLES - 39 used
integer Pick, Choice, Done, GoAhead, Count, KeepOn, Flag, Item, BinCnt
integer MailRecd, MailSent, MesgRecd, MesgSent, FileRecd, FileSent, MailWait
integer Cfg11, Cfg12, Cfg13, Cfg14, Cfg15, Cfg16
integer Tour, TourMax
;integer Var, Num, Len, Temp
; ^I6 ^I7 ^I8 ^I9
;integer MultiTask,Task1,Task2,Task3,Task4,Task5
; ^I0 ^I1 ^I2 ^I3 ^I4 ^I5
;Long STime ==> L1
; ========================= Beginning of Script ============================
PROC Main
integer newmenu, menu1, menu2, menu3, menu5, menu6
isfile "AUTOCIS.CFG"
if success
Call ReadCfg
MailDir=Cfg8 ; define directories
FileDir=Cfg9
LogDir=Cfg10
else
sdlgmsgbox "Initial Program Startup" "Personal User information needed" STOP OK choice BEEP
Cfg11=1,Cfg12=0,Cfg13=1,Cfg14=0,Cfg15=1,Cfg16=0 ; defaults for CfgOptions
Call PerConfig
Call DirConfig
Call SaveCfg
endif
if $FROMDDIR
Call LogOn
Call ExitWait
goto MainEnd
endif
if eq Cfg11 1
Call ProgInfo
endif
getwintext $ACTIVEWIN Title
CISTitle="Running AUTOCIS script within PROCOMM PLUS for Windows"
pwtitlebar CISTitle
menubar newmenu
menupopup newmenu "&Mail" menu1
menuitem menu1 1 "Send &Composed Mail"
menuitem menu1 2 "Send Mail &File"
menuitem menu1 3 "&Receive Mail"
menuitem menu1 4 "&Write/Edit Letter"
menuitem menu1 5 "&View/Edit Capture"
menupopup newmenu "&Forums" menu2
menuitem menu2 6 Forum1
menuitem menu2 7 Forum2
menuitem menu2 8 Forum3
menuitem menu2 9 Forum4
menuitem menu2 10 Forum5
menuitem menu2 11 Forum6
menuitem menu2 12 Forum7
menuitem menu2 13 "&User Specified"
menupopup newmenu "&Ziff Net" menu3
menuitem menu3 14 "&After Hours"
menuitem menu3 15 "&Editorial"
menuitem menu3 16 "&Programming"
menuitem menu3 17 "&Utilities"
menuitem menu3 18 "Public &Brand"
menuitem menu3 19 "&SoftLib Files"
menupopup newmenu "&Setup" menu5
menuitem menu5 25 "&User Info"
menuitem menu5 26 "&Directory Info"
menuitem menu5 27 "&Options"
menuitem menu5 28 "&Save Setup"
menuitem menu5 29 "&Program Data"
menupopup newmenu "&Other" menu6
menuitem menu6 30 "&Multiple Tasks"
menuitem menu6 31 "&Restart dialing"
menuitem menu6 32 "E&xit program"
showmenu newmenu
if eq Cfg11 1
UserMsg "> Select Topic from top menu bar`r\
(Mail Forum Ziff Net .....)`r`r\
> Choose area from drop down menu`r`r\
> Dialog box will be displayed if needed`r`r\
> Choose Activity from dialog box`r`r\
{ Turn off Option 1 to remove this display }"
endif
when menu call Controller
while 1
endwhile
MainEnd:
ENDPROC ;Main
PROC Controller
integer status=$MENU
clearwhen menu
switch status
case 1
Order="Mail"
Order1="GO CIS:MAIL"
Order2=$NULLSTR
Order3="Send Text"
GoAhead=1
Call Initiate
endcase
case 2
Order="Mail"
Order1="GO CIS:MAIL"
Order2=$NULLSTR
Order3="UPL"
Call Filename
Order3="Send File"
if Done=1
Call Initiate
endif
endcase
case 3
Order="Mail"
Order1="GO CIS:MAIL"
Order2=$NULLSTR
Order3="Get Mail"
GoAhead=1
Call Initiate
endcase
case 4
DirName=MailDir
UseFile="LETTERS.OUT"
Call DoEdit
endcase
case 5
DirName=LogDir
Call DefineLog
UseFile=LogName
Call DoEdit
endcase
case 6
Order="Forum"
Order1="GO CIS:"
strcat Order1 ForCmd1
Call Forum
Call Initiate
endcase
case 7
Order="Forum"
Order1="GO CIS:"
strcat Order1 ForCmd2
Call Forum
Call Initiate
endcase
case 8
Order="Forum"
Order1="GO CIS:"
strcat Order1 ForCmd3
Call Forum
Call Initiate
endcase
case 9
Order="Forum"
Order1="GO CIS:"
strcat Order1 ForCmd4
Call Forum
Call Initiate
endcase
case 10
Order="Forum"
Order1="GO CIS:"
strcat Order1 ForCmd5
Call Forum
Call Initiate
endcase
case 11
Order="Forum"
Order1="GO CIS:"
strcat Order1 ForCmd6
Call Forum
Call Initiate
endcase
case 12
Order="Forum"
Order1="GO CIS:"
strcat Order1 ForCmd7
Call Forum
Call Initiate
endcase
case 13
sdlginput "USER SPECIFIED FORUM" "Enter name of desired Forum" UserFor
Order1="GO CIS:"
strcat Order1 UserFor
Order="Forum"
Call Forum
Call Initiate
endcase
case 14
Order="Forum"
Order1="GO ZNT:AFTERHOURS"
Call Forum
Call Initiate
endcase
case 15
Order="Forum"
Order1="GO ZNT:EDITORIAL"
Call Forum
Call Initiate
endcase
case 16
Order="Forum"
Order1="GO ZNT:PROGRAM"
Call Forum
Call Initiate
endcase
case 17
Order="Forum"
Order1="GO ZNT:UTILFORUM"
Call Forum
Call Initiate
endcase
case 18
Order="Forum"
Order1="GO ZNT:PBS"
Call Forum
Call Initiate
endcase
case 19
Order="SoftLib"
Order1="GO ZNT:SOFTLIB"
Call SoftDef
Call Initiate
endcase
case 25
Call PerConfig
endcase
case 26
Call DirConfig
endcase
case 27
Call OptConfig
endcase
case 28
Call SaveCfg
endcase
case 29
Call ProgInfo
endcase
case 30
Call ClearTask
I0=1
Call Initiate
endcase
case 31
GoAhead=1
Call Initiate
endcase
case 32 ; if EXIT was selected
sdlgmsgbox "AutoCIS Script Program" "Do you want to exit the AutoCIS Script?"\
QUESTION YESNO I7 BEEP
switch I7
case 6 ; this is yes
Title="PROCOMM PLUS for Windows"
pwtitlebar Title
halt
endcase
case 7 ; this is no
pwtitlebar CISTitle
exitswitch
endcase
endswitch
endcase
endswitch
when menu call Controller
ENDPROC ;Controller
PROC Initiate
if eq I0 1 ; indicates to store in Multi Task
Call Multi
endif
if eq GoAhead 0
goto InitiateOut ; go back for next task if MultiTasking
endif
if eq Cfg13 1
sdlgmsgbox "CALL INITIATION" "Continue to place call ?" QUESTION OKCANCEL I7 2 BEEP
endif
switch I7
case 1
if eq Tour 0
Call LogOn
if eq KeepOn 1 ; if still connected
transmit Order1 ; transmit specified destination
transmit "^M"
else
pwtitlebar CISTitle
goto InitiateOut ; in case connection was lost
endif
Call PickArea
strcmp Order3 "Manual mode" ; if this is Manual mode
if not success ; logging off has been performed
Call LogOff
endif
else
Call OnTour
endif
pwtitlebar CISTitle
Call Summary
endcase
case 2
Order1=$NULLSTR
Order2=$NULLSTR
Order3=$NULLSTR
Order4=$NULLSTR
Order5=$NULLSTR
Join=$NULLSTR
endcase
endswitch
InitiateOut:
GoAhead=0
ENDPROC ;Initiate
PROC PickArea
switch Order
case "Mail"
Call MailRun ; on line Mail procedures
endcase
case "Forum"
Call ForumRun ; on line Forum procedures
endcase
case "SoftLib"
Call SoftRun ; on line Ziff Net SoftLib procedures
endcase
endswitch
ENDPROC ;PickArea
PROC OnTour
Tour = 0
Order1=$NULLSTR
StartTask:
inc Tour
TempS=Order1 ; save previous Order1
switch Tour
case 1
Order=Locn1
Order1="GO "
strcat Order1 Area1
strupr Order1
Order2=Sect1
strupr Order2
Order3=Actn1
strupr Order3
Order4=Extn1
endcase
case 2
Order=Locn2
Order1="GO "
strcat Order1 Area2
strupr Order1
Order2=Sect2
strupr Order2
Order3=Actn2
strupr Order3
Order4=Extn2
endcase
case 3
Order=Locn3
Order1="GO "
strcat Order1 Area3
strupr Order1
Order2=Sect3
strupr Order2
Order3=Actn3
strupr Order3
Order4=Extn3
endcase
case 4
Order=Locn4
Order1="GO "
strcat Order1 Area4
strupr Order1
Order2=Sect4
strupr Order2
Order3=Actn4
strupr Order3
Order4=Extn4
endcase
case 5
Order=Locn5
Order1="GO "
strcat Order1 Area5
strupr Order1
Order2=Sect5
strupr Order2
Order3=Actn5
strupr Order3
Order4=Extn5
endcase
endswitch
if eq Tour 1 ; if first multi task
Call LogOn
if eq KeepOn 1 ; if not connected
transmit Order1 ; transmit specified destination
transmit "^M"
else
pwtitlebar CISTitle
goto TourOut ; in case connection was lost
endif
else ; if second or later multi task
strcmp TempS Order1 ; is this Order1 the same as the last ?
if success ; if staying in Forum
transmit "B^M" ; back up to top menu
waitfor "!" 3
else ; if new area is specified
transmit "EXIT^M" ; exit forum - this stops command mode
waitfor "Enter choice" 10
transmit "T^M" ; request CIS top menu
waitfor "Enter choice" 10
transmit Order1 ; send GO command for new area
transmit "^M"
endif
endif
; continue as if this is a single activity session
Call PickArea ; select where to go (Mail,Forum,Other)
; return here from Forum, Mail or Assist
if eq Tour TourMax
strcmp Order3 "Manual mode" ; if this is Manual mode
if not success ; logging off has been performed
Call LogOff
endif
else
goto StartTask ; go to perform next Task
endif
Tour=0
TourMax=0
TourOut:
ENDPROC ;OnTour
PROC Summary
ITOA MailRecd MailIn
ITOA MailSent MailOut
ITOA MesgRecd MesgIn
ITOA MesgSent MesgOut
ITOA FileRecd FileIn
ITOA FileSent FileOut
dialogbox 120 90 125 115 2 "CIS ACTIVITY SUMMARY"
pushbutton 44 90 40 14 "Proceed" normal
text 25 10 62 9 left "Letters Received :"
text 25 20 62 9 left "Letters Sent :"
text 25 35 62 9 left "Messages Rec'd :"
text 25 45 62 9 left "Messages Sent :"
text 25 60 62 9 left "Files DnLoaded :"
text 25 70 62 9 left "Files UpLoaded :"
vtext 90 10 20 9 left Mailin
vtext 90 20 20 9 left Mailout
vtext 90 35 20 9 left MesgIn
vtext 90 45 20 9 left MesgOut
vtext 90 60 20 9 left FileIn
vtext 90 70 20 9 left FileOut
enddialog
while not $DIALOG
endwhile
MailIn=$NULLSTR
MailOut=$NULLSTR
MesgIn=$NULLSTR
MesgOut=$NULLSTR
FileIn=$NULLSTR
FileOut=$NULLSTR
MailRecd=0
MailSent=0
MesgRecd=0
MesgSent=0
FileRecd=0
FileSent=0
ENDPROC ;Summary
PROC ShoBox
dialogbox 120 50 120 150 2 "SELECTIONS"
groupbox 10 15 100 105 shadow
radiobutton 15 160 8 8 "" Pick
radiobutton 15 25 8 8 ""
radiobutton 15 35 8 8 ""
radiobutton 15 45 8 8 ""
radiobutton 15 55 8 8 ""
radiobutton 15 65 8 8 ""
radiobutton 15 75 8 8 ""
radiobutton 15 85 8 8 ""
radiobutton 15 95 8 8 ""
radiobutton 15 105 8 8 "" endgroup
pushbutton 10 130 45 15 "Proceed" normal default
pushbutton 65 130 45 15 "Cancel" normal
vtext 5 5 78 10 left S1
vtext 25 25 80 8 left S2
vtext 25 35 80 8 left S3
vtext 25 45 80 8 left S4
vtext 25 55 80 8 left S5
vtext 25 65 80 8 left S6
vtext 25 75 80 8 left S7
vtext 25 85 80 8 left S8
vtext 25 95 80 8 left S9
vtext 25 105 80 8 left S0
enddialog
ENDPROC ;ShoBox
; -------------------------------------------
; | DEFINITION OF FORUM ACTIVITIES |
; -------------------------------------------
PROC Forum
Call JoinForum
Call SectionBox
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10 ; accept inputs & exit
Done=1
GoAhead=1
exitwhile
endcase
case 11 ; cancel & exit
Order1=$NULLSTR
Order2=$NULLSTR
Order3=$NULLSTR
Order4=$NULLSTR
GoAhead=0
exitwhile
endcase
case 50
switch Pick
case 1
endcase
case 2
Order2="INSTRUCTIONS"
Order3="Manual mode"
usermsg "Requires User supplied commands"
endcase
case 3
Order2="MESSAGES"
Call ShoMes
if eq Done 1
exitwhile
endif
Pick=3
Call SectionBox
endcase
case 4
Order2="LIBRARIES"
Call ShoLib
if eq Done 1
exitwhile
endif
Pick=3
Call SectionBox
endcase
case 5
Order2="CONFERENCE"
Order3="Manual mode"
usermsg "Requires User supplied commands"
endcase
case 6
Order2="ANNOUNCE"
Order3="Manual mode"
usermsg "Requires User supplied commands"
endcase
case 7
Order2="DIRECTORY"
Order3="Manual mode"
usermsg "Requires User supplied commands"
endcase
case 8
Order2="OPTIONS"
Order3="Manual mode"
usermsg "Requires User supplied commands"
endcase
case 9
Call ShoList
Call SectionBox
endcase
case 10
DirName=LogDir
UseFile="MESSAGES."
substr TempS Order1 7 3
strcat UseFile TempS
Call DoEdit
Call SectionBox
endcase
endswitch
endcase
endswitch
endwhile
ENDPROC ;Forum
PROC SectionBox
Pick=1
S1="FORUM SECTIONS"
S2="Instructions"
S3="Messages"
S4="Libraries"
S5="Conference"
S6="Announcements"
S7="Member Directory"
S8="Options of Forum"
S9="Section/Library List"
S0="Write/Edit message(s)"
Call ShoBox
ENDPROC ;SectionBox
PROC ShoMes
Pick=1
S1="MESSAGE ACTIVITIES"
S2="Send message(s)"
S3="Read New"
S4="Read To"
S5="Read From"
S6="Read Thread"
S7="Find Root"
S8="Read Starting"
S9="Read Days"
S0="Delete message"
Call ShoBox
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10 ; accept inputs & exit
Done=1
GoAhead=1
exitwhile
endcase
case 11 ; cancel & exit
Done=1
Order1=$NULLSTR
Order2=$NULLSTR
Order3=$NULLSTR
Order4=$NULLSTR
GoAhead=0
Pick=1
exitwhile
endcase
case 50
switch Pick
case 1
endcase
case 2
Order3="Send Mesg"
Order4=$NULLSTR
endcase
case 3
Order3="REA NEW"
Order4=$NULLSTR
endcase
case 4
Order3="REA ALL TO:"
sdlginput "INPUT REQUEST" "Enter User ID number" Order4
endcase
case 5
Order3="REA ALL FRO "
sdlginput "INPUT REQUEST" "Enter User ID number" Order4
endcase
case 6
Order3="REA THR NUM:"
sdlginput "INPUT REQUEST" "Enter message number" Order4
endcase
case 7
Order3="ROO:"
sdlginput "INPUT REQUEST" "Enter message number" Order4
endcase
case 8
Order3="REA STA:"
sdlginput "INPUT REQUEST" "Enter message number" Order4
endcase
case 9
Order3="REA DAY:"
sdlginput "INPUT REQUEST" "Enter number of days" Order4
endcase
case 10
Order3="DEL:"
sdlginput "INPUT REQUEST" "Enter message number" Order4
endcase
endswitch
endcase
endswitch
endwhile
ENDPROC ;ShoMes
PROC ShoLib
Pick=1
Call LibBox
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10 ; accept inputs & exit
Done=1
GoAhead=1
exitwhile
endcase
case 11 ; cancel & exit
Done=0
GoAhead=0
Order1=$NULLSTR
Order2=$NULLSTR
Order3=$NULLSTR
Order4=$NULLSTR
exitwhile
endcase
case 50
switch Pick
case 1
endcase
case 2
Order3="Manual mode"
Order4=$NULLSTR
usermsg "Requires User supplied commands"
endcase
case 3 ; this is browse of library
Order3="BRO LIB:"
sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
strcat Order3 TempS
Order4=$NULLSTR
usermsg "Requires User supplied commands"
endcase
case 4 ; this is count of files
Order3="COU LIB:"
sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
strcat Order3 TempS
Order4=$NULLSTR
endcase
case 5 ; this is short directory
Order3="LIST COU"
sdlginput "INPUT REQUEST" "Enter Number of day(s)" TempS
strcmp TempS $NULLSTR
if failure
strcat Order3 " AGE:"
strcat Order3 TempS
endif
Order4=" LIB:"
sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
strcat Order4 TempS
endcase
case 6 ; this is descriptive directory
Order3="SCA DES"
sdlginput "INPUT REQUEST" "Enter Number of day(s)" TempS
strcmp TempS $NULLSTR
if failure
strcat Order3 " AGE:"
strcat Order3 TempS
endif
Order4=" LIB:"
sdlginput "INPUT REQUEST" "Enter Library number(s)" TempS
strcat Order4 TempS
sdlginput "INPUT REQUEST" "Enter Keywords for listing" TempS
strcmp TempS $NULLSTR
if failure
strcat Order4 " KEY:"
strcat Order4 TempS
endif
endcase
case 7
Order3="UPL"
Call Filename
Call LibBox
endcase
case 8
Order3="DOW"
Call Filename
Call LibBox
endcase
case 9
Order3="ERA"
Call Filename
Call LibBox
endcase
case 10
endcase
endswitch
endcase
endswitch
endwhile
ENDPROC ;ShoLib
PROC ShoList
Call GetList
dialogbox 80 20 200 200 2 "SECTION DESCRIPTIONS"
text 15 4 116 8 left "Message Section List"
text 15 14 116 4 left "~~~~~~~~~~~~~~~"
text 115 4 116 8 left "Library Section List"
text 115 14 116 4 left "~~~~~~~~~~~~~~"
vtext 12 20 185 8 left S1
vtext 12 30 185 8 left S2
vtext 12 40 185 8 left S3
vtext 12 50 185 8 left S4
vtext 12 60 185 8 left S5
vtext 12 70 185 8 left S6
vtext 12 80 185 8 left S7
vtext 12 90 185 8 left S8
vtext 12 100 185 8 left S9
vtext 12 110 185 8 left S0
vtext 12 120 185 8 left var1
vtext 12 130 185 8 left var2
vtext 12 140 185 8 left var3
vtext 12 150 185 8 left var4
vtext 12 160 185 8 left var5
vtext 12 170 185 8 left var6
pushbutton 75 180 50 15 "Finished" normal default
enddialog
choice=$DIALOG
while choice != 1
choice=$DIALOG
if eq choice 10
exitwhile
endif
endwhile
ENDPROC ;ShoList
#INCLUDE "AUTOCIS.INC"
PROC LibBox
S1="LIBRARY ACTIVITIES"
S2="Manual mode"
S3="Browse"
S4="File Count"
S5="Short Directory"
S6="Descriptive Directory"
S7="Upload File(s)"
S8="Download File(s)"
S9="Remove File"
S0=""
Call ShoBox
ENDPROC ;LibBox
PROC JoinForum
strlen Order1 I8
sub I8 7 I6
substr WordS Order1 7 I6 ; WordS is Area name (i.e. DSTORM)
isfile "AUTOCIS.LST"
if success
fopen 0 "AUTOCIS.LST" READ TEXT
while not FEOF 0
Fgets 0 TempS
strfind TempS WordS
if found
fclose 0
goto JoinOut
endif
endwhile
fclose 0
else
fopen 0 "AUTOCIS.LST" CREATE TEXT
fclose 0
endif
sdlgmsgbox "FORUM MEMBERSHIP STATUS" "You are presently not a member of this Forum !\
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * \
Do you wish to JOIN the Forum at this time ?" STOP YESNO I7 BEEP
switch I7
case 6 ; this is yes
Join=WordS ; Join is Area name
fopen 0 "AUTOCIS.LST" WRITE TEXT
fseek 0 0 2 ; move pointer to just before EOF marker
strlen WordS I8
fwrite 0 WordS I8
fputc 0 10
fclose 0
endcase
case 7 ; this is no
goto JoinOut
endcase
endswitch
JoinOut:
ENDPROC ;JoinForum
; --------------------------------------------------
; | DEFINITION OF ZIFF SOFTLIB ACTIVITIES |
; --------------------------------------------------
PROC SoftDef
Pick=1
Call SoftBox
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10 ; accept inputs & exit
Done=1
GoAhead=1
exitwhile
endcase
case 11 ; cancel & exit
Done=0
GoAhead=0
Order1=$NULLSTR
Order2=$NULLSTR
Order3=$NULLSTR
Order4=$NULLSTR
exitwhile
endcase
case 50
switch Pick
case 1
endcase
case 2 ; download latest files
Order2="1"
Order3="Manual mode"
Order4=$NULLSTR
usermsg "Requires User supplied commands"
endcase
case 3 ; Essential software kits
Order2="2"
Order3="Manual mode"
Order4=$NULLSTR
usermsg "Requires User supplied commands"
endcase
case 4 ; search for a utility
Order2="3"
Call SoftSearch
if eq Done 1
exitwhile
endif
Pick=4
Call SoftBox
endcase
case 5 ; download a utility
Order2="4"
Order3="DOW"
Call FileName
if eq Done 1
exitwhile
endif
Pick=5
Call SoftBox
endcase
case 6 ; download a PCM utility
Order2="7"
Order3="Manual mode"
endcase
case 7 ; about the Library
Order2="10"
endcase
case 8 ; search instructions
Order2="11"
endcase
case 9 ; uploading submissions
Order2="12"
Order3="Manual mode"
endcase
case 10
endcase
endswitch
endcase
endswitch
endwhile
ENDPROC ;SoftDef
PROC SoftBox
S1="SOFTLIB ACTIVITIES"
S2="Download Latest Files"
S3="Essential Software Kits"
S4="Search for a Utility"
S5="Download a Utility"
S6="About the Library"
S7="Search Instructions"
S8="Uploading Submissions"
S9=""
S0=""
Call ShoBox
ENDPROC ;SoftBox
PROC SoftSearch
Pick=1
Call SearchBox
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10 ; accept inputs & exit
Done=1
GoAhead=1
exitwhile
endcase
case 11 ; cancel & exit
Done=0
GoAhead=0
Order1=$NULLSTR
Order2=$NULLSTR
Order3=$NULLSTR
Order4=$NULLSTR
exitwhile
endcase
case 50
switch Pick
case 1
endcase
case 2 ; number 1 type utility
Order3="1"
Order4="Manual mode"
Order5=$NULLSTR
usermsg "Requires User supplied commands"
endcase
case 3 ; number 2 keyword
Order3="2"
sdlginput "INPUT REQUEST" "Enter Keyword:" Order4
Order5=$NULLSTR
endcase
case 4 ; number 3 PC M files
Order3="3"
Order4="Manual mode"
Order5=$NULLSTR
usermsg "Requires User supplied commands"
endcase
case 5 ; number 4 PC C files
Order3="4"
Order4="Manual mode"
Order5=$NULLSTR
usermsg "Requires User supplied commands"
endcase
case 6 ; number 5 PC W files
Order3="5"
Order4="Manual mode"
Order5=$NULLSTR
usermsg "Requires User supplied commands"
endcase
case 7 ; number 6 File name
Order3="6"
sdlginput "INPUT REQUEST" "Enter Filename:" Order4
Order5=$NULLSTR
endcase
case 8 ; number 7 Date
Order3="7"
sdlginput "INPUT REQUEST" "Enter Release date:" Order4
Order5=$NULLSTR
endcase
case 9 ; number 8 Author
Order3="8"
sdlginput "INPUT REQUEST" "Enter Author UID #:" Order4
Order5=$NULLSTR
endcase
case 10
endcase
endswitch
endcase
endswitch
endwhile
ENDPROC ;SoftSearch
PROC Searchbox
S1="SEARCH TYPE"
S2="Type of Utility"
S3="Keyword"
S4="PC Magazine Files"
S5="PC Computing Files"
S6="PC Week Files"
S7="File Name"
S8="Date"
S9="Author"
S0=""
Call ShoBox
ENDPROC ;SoftBox
; --------------------------------------------------------------
; | DEFINITION OF FILENAMES FOR UPLOAD OR DOWNLOAD |
; --------------------------------------------------------------
PROC Filename
FileList=Cfg9 ; this is file directory
strcat FileList "\File"
strcat FileList Order3
strcat FileList "."
substr Char Order1 7 3
strcat FileList Char
isfile FileList
if success
sdlgmsgbox "FILENAME LIST" "Over write existing list ?" QUESTION YESNO choice
switch choice
case 7 ; this is no
Done=1
GoAhead=1
goto FilenameOut
endcase
endswitch
endif
fopen 0 FileList CREATE TEXT
Call ClrFilename
Call FileBox
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10 ; add a filename
Call DefineFile
Call FileBox
endcase
case 11 ; clear data
fclose 0
fopen 0 FileList CREATE TEXT ; this clears the file to no contents
Call ClrFilename
Call FileBox
endcase
case 12 ; cancel
fclose 0
fopen 0 FileList CREATE TEXT ; clear the file contents
fclose 0
Done=0
GoAhead=0
exitwhile
endcase
case 13 ; finished
fwrite 0 "END" 3
fputc 0 10
fputc 0 10
fclose 0
Done=1
GoAhead=1
exitwhile
endcase
endswitch
endwhile
FilenameOut:
ENDPROC ;Filename
PROC FileBox
dialogbox 90 70 195 145 2 "UPLOAD/DOWNLOAD FILENAME DEFINITION"
text 25 5 20 8 left "Lib #"
text 50 5 20 8 left "Type"
text 90 5 30 8 left "Filename"
text 140 5 50 8 left "Source User ID"
text 5 20 8 8 right "1"
text 5 30 8 8 right "2"
text 5 40 8 8 right "3"
text 5 50 8 8 right "4"
text 5 60 8 8 right "5"
text 5 70 8 8 right "6"
text 5 80 8 8 right "7"
text 5 90 8 8 right "8"
text 5 100 8 8 right "9"
text 5 110 8 8 right "10"
vtext 28 20 165 8 left File1
vtext 28 30 165 8 left File2
vtext 28 40 165 8 left File3
vtext 28 50 165 8 left File4
vtext 28 60 165 8 left File5
vtext 28 70 165 8 left File6
vtext 28 80 165 8 left File7
vtext 28 90 165 8 left File8
vtext 28 100 165 8 left File9
vtext 28 110 165 8 left File10
pushbutton 6 125 40 15 "Add File" normal
pushbutton 54 125 40 15 "Clear Data" normal
pushbutton 102 125 40 15 "Cancel" normal
pushbutton 150 125 40 15 "Proceed" normal
enddialog
ENDPROC ;FileBox
PROC ClrFilename
File1=$NULLSTR
File2=$NULLSTR
File3=$NULLSTR
File4=$NULLSTR
File5=$NULLSTR
File6=$NULLSTR
File7=$NULLSTR
File8=$NULLSTR
File9=$NULLSTR
File10=$NULLSTR
ENDPROC ;ClrFilename
PROC DefineFile
strcmp Order1 "GO CIS:MAIL"
if success
WordS=" "
goto SkipLib
endif
strcmp Order1 "GO ZNT:SOFTLIB"
if success
WordS=" "
goto SkipLib
endif
sdlginput "LIBRARY DEFINITION" "Enter Library:" TempS
strlen TempS I8
if I8 != 2
WordS=" "
strcat WordS TempS
else
WordS=TempS
endif
strcat WordS " "
fwrite 0 TempS I8
fputc 0 10
SkipLib:
strcmp Order3 "UPL"
if success
sdlginput "FILE TYPE DEFINITION" "Enter Type of file (ASC,BIN):" TempS
strupr TempS
strcat WordS TempS
strcmp TempS "BIN"
if success
strcat WordS " "
else
strcat WordS " "
endif
strlen TempS I8
fwrite 0 TempS I8
fputc 0 10
else
strcat WordS " "
endif
sdlginput "FILENAME DEFINITION" "Enter Filename including extension:" TempS
strupr TempS
strcat WordS TempS
strcat WordS " "
strlen TempS I8
fwrite 0 TempS I8
fputc 0 10
strcmp Order3 "UPL"
if success
strcmp Order1 "GO CIS:MAIL"
if success
goto DefineFin
endif
; provide for ASCII send of Description
usermsg "Provide Description - not to exceed 6 2/3 lines"
DescAgain:
strcmpi $WINMODE "STANDARD" ; not needed in Enhanced mode
if success
I7=$CONNECTION
inc I7
set connection port none
endif
Name=Cfg7 ; this is editor path\filename
strcat Name " "
Char=Cfg9 ; this is files directory
strcat Char "\"
strcat Char "DESCRIPT.TMP"
strcat Name Char
run Name MAXIMIZED
strcmpi $WINMODE "STANDARD" ; reset for Standard mode
if success
set connection port I7
endif
fopen 1 Char READ TEXT
I7=0
for I6=1 upto 7
TempS=$NULLSTR
fgets 1 TempS
strcmp TempS $NULLSTR
if success
exitfor
endif
strlen TempS I8
fwrite 0 TempS I8
add I7 I8 I7
inc I7
fputc 0 10
endfor
fwrite 0 "/EXIT" 5
fputc 0 10
fclose 1
sub I7 538 I7
if I7 > 0
BEEP
add I7 48 I7
usermsg "Description is over length by %c characters." I7
goto DescAgain
endif
delfile Char ; deletes temporary file
; input and store Keywords
DefineFin:
TempS=$NULLSTR
KeyAgain:
strcmp Order1 "GO CIS:MAIL"
if success
sdlginput "ADDRESSEE OF FILE" "Enter Addressee and user ID :" TempS DEFAULT
else
sdlginput "KEYWORDS FOR UPLOAD" "Enter Keywords for Upload (80 character maximum) :" TempS DEFAULT
endif
strlen TempS I8
sub I8 80 I7
if I7 > 0
BEEP
add I7 48 I7
usermsg "Keywords is over length by %c characters." I7
goto KeyAgain
endif
fwrite 0 TempS I8
fputc 0 10
; input and store Title
TempS=$NULLSTR
TitleAgain:
strcmp Order1 "GO CIS:MAIL"
if success
sdlginput "SUBJECT OF FILE" "Enter Subject for CIS use :" TempS DEFAULT
else
sdlginput "TITLE FOR UPLOAD" "Enter Title of Upload (47 character maximum) :" TempS DEFAULT
endif
strlen TempS I8
sub I8 47 I7
if I7 > 0
BEEP
add I7 48 I7
usermsg "Title is over length by %c characters." I7
goto TitleAgain
endif
strlen TempS I8
fwrite 0 TempS I8
fputc 0 10
endif
strcmp File1 $NULLSTR
if success
File1=WordS
goto DefineEnd
endif
strcmp File2 $NULLSTR
if success
File2=WordS
goto DefineEnd
endif
strcmp File3 $NULLSTR
if success
File3=WordS
goto DefineEnd
endif
strcmp File4 $NULLSTR
if success
File4=WordS
goto DefineEnd
endif
strcmp File5 $NULLSTR
if success
File5=WordS
goto DefineEnd
endif
strcmp File6 $NULLSTR
if success
File6=WordS
goto DefineEnd
endif
strcmp File7 $NULLSTR
if success
File7=WordS
goto DefineEnd
endif
strcmp File8 $NULLSTR
if success
File8=WordS
goto DefineEnd
endif
strcmp File9 $NULLSTR
if success
File9=WordS
goto DefineEnd
endif
strcmp File10 $NULLSTR
if success
File10=WordS
goto DefineEnd
endif
DefineEnd:
ENDPROC ;DefineFile
; ---------------------------------------------------
; | PROCEDURES FOR DEFINING MULTIPLE TASKS |
; ---------------------------------------------------
PROC Multi
if eq Tour 1
Locn1=Order
substr Area1 Order1 3 10
strlwr Area1
Sect1=Order2
strlwr Sect1
Actn1=Order3
strlwr Actn1
ShoTask1=Order3
Extn1=Order4
strcat ShoTask1 Order4
strlwr ShoTask1
endif
if eq Tour 2
I1=1
Locn2=Order
substr Area2 Order1 3 10
strlwr Area2
Sect2=Order2
strlwr Sect2
Actn2=Order3
strlwr Actn2
ShoTask2=Order3
Extn2=Order4
strcat ShoTask2 Order4
strlwr ShoTask2
endif
if eq Tour 3
I1=1
I2=1
Locn3=Order
substr Area3 Order1 3 10
strlwr Area3
Sect3=Order2
strlwr Sect3
Actn3=Order3
strlwr Actn3
ShoTask3=Order3
Extn3=Order4
strcat ShoTask3 Order4
strlwr ShoTask3
endif
if eq Tour 4
I1=1
I2=1
I3=1
Locn4=Order
substr Area4 Order1 3 10
strlwr Area4
Sect4=Order2
strlwr Sect4
Actn4=Order3
strlwr Actn4
ShoTask4=Order3
Extn4=Order4
strcat ShoTask4 Order4
strlwr ShoTask4
endif
if eq Tour 5
I1=1
I2=1
I3=1
I4=1
Locn5=Order
substr Area5 Order1 3 10
strlwr Area5
Sect5=Order2
strlwr Sect5
Actn5=Order3
strlwr Actn5
ShoTask5=Order3
Extn5=Order4
strcat ShoTask5 Order4
strlwr ShoTask5
endif
Call MultiBox
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10
Call ClearTask
Call MultiBox
endcase
case 11
GoAhead=1
I0=0
exitwhile
endcase
case 12
Call ClearTask
GoAhead=0
I0=0
exitwhile
endcase
case 70
if eq I1 1
if eq Tour 0
Tour=1
GoAhead=0
exitwhile
endif
endif
endcase
case 71
if eq I2 1
if eq Tour 1
Tour=2
GoAhead=0
exitwhile
endif
endif
endcase
case 72
if eq I3 1
if eq Tour 2
Tour=3
GoAhead=0
exitwhile
endif
endif
endcase
case 73
if eq I4 1
if eq Tour 3
Tour=4
GoAhead=0
exitwhile
endif
endif
endcase
case 74
if eq I5 1
if eq Tour 4
Tour=5
GoAhead=0
exitwhile
endif
endif
endcase
endswitch
endwhile
destroydlg
TourMax = Tour ; TourMax is total number of Tasks
ENDPROC ;Multi
PROC MultiBox
dialogbox 75 90 205 110 6 "MULTIPLE TASK DEFINITION"
text 10 10 190 70 left "DEFINE TASKS:"
checkbox 15 22 35 10 "Task 1" I1
checkbox 15 34 35 10 "Task 2" I2
checkbox 15 46 35 10 "Task 3" I3
checkbox 15 58 35 10 "Task 4" I4
checkbox 15 70 35 10 "Task 5" I5
pushbutton 10 88 55 15 "Clear Tasks" normal
pushbutton 75 88 55 15 "Proceed" normal
pushbutton 140 88 55 15 "Cancel" normal
vtext 55 24 33 9 left Area1
vtext 55 36 33 9 left Area2
vtext 55 48 33 9 left Area3
vtext 55 60 33 9 left Area4
vtext 55 72 33 9 left Area5
vtext 90 24 35 9 left Sect1
vtext 90 36 35 9 left Sect2
vtext 90 48 35 9 left Sect3
vtext 90 60 35 9 left Sect4
vtext 90 72 35 9 left Sect5
vtext 130 24 70 9 left ShoTask1 ; Actn + Extn
vtext 130 36 70 9 left ShoTask2
vtext 130 48 70 9 left ShoTask3
vtext 130 60 70 9 left ShoTask4
vtext 130 72 70 9 left ShoTask5
enddialog
ENDPROC ;MultiBox
PROC ClearTask
Tour=0
I1=0
I2=0
I3=0
I4=0
I5=0
Area1=$NULLSTR
Area2=$NULLSTR
Area3=$NULLSTR
Area4=$NULLSTR
Area5=$NULLSTR
Sect1=$NULLSTR
Sect2=$NULLSTR
Sect3=$NULLSTR
Sect4=$NULLSTR
Sect5=$NULLSTR
Actn1=$NULLSTR
Actn2=$NULLSTR
Actn3=$NULLSTR
Actn4=$NULLSTR
Actn5=$NULLSTR
Extn1=$NULLSTR
Extn2=$NULLSTR
Extn3=$NULLSTR
Extn4=$NULLSTR
Extn5=$NULLSTR
ShoTask1=$NULLSTR
ShoTask2=$NULLSTR
ShoTask3=$NULLSTR
ShoTask4=$NULLSTR
ShoTask5=$NULLSTR
ENDPROC ;ClearTask
; -------------------------------------------------
; | PROCEDURES FOR DEFINING CONFIGURATION |
; -------------------------------------------------
PROC PerConfig
dialogbox 115 70 130 155 2 "PERSONAL INFORMATION"
pushbutton 6 5 57 15 "Access phone" update
pushbutton 6 25 57 15 "User ID number" update
pushbutton 6 45 57 15 "CIS Password" update
pushbutton 6 65 57 15 "Baud rate" update
pushbutton 6 85 57 15 "MNP message" update
pushbutton 6 105 57 15 "Name for Forum" update
pushbutton 35 130 60 15 "Finished" normal default
vtext 66 8 60 12 left Cfg1
vtext 66 28 60 12 left Cfg2
vtext 66 48 60 12 left Cfg0
vtext 66 68 60 12 left Cfg4
vtext 66 88 60 12 left Cfg5
vtext 66 108 60 12 left Cfg6
enddialog
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10
exitwhile
endcase
case 30
sdlginput "Phone Request" "Input CIS access number:" Cfg1 DEFAULT
updatedlg 64
endcase
case 31
sdlginput "User ID Request" "Input your User ID number:" Cfg2 DEFAULT
updatedlg 64
endcase
case 32
sdlginput "Password Request" "Input your password:" Cfg3 DEFAULT
updatedlg 64
endcase
case 33
sdlginput "Baud Rate Request" "Input Baud rate:" Cfg4 DEFAULT
updatedlg 64
endcase
case 34
sdlginput "MNP response Request" "Input MNP message:" Cfg5 DEFAULT
updatedlg 64
endcase
case 35
sdlginput "Name for Forum Request" "Input name to use in Forum:" Cfg6 DEFAULT
updatedlg 64
endcase
endswitch
endwhile
ENDPROC ;PerConfig
PROC DirConfig
dialogbox 80 70 200 115 2 "DIRECTORY INFORMATION"
pushbutton 6 5 57 15 "Editor Filename" update
pushbutton 6 25 57 15 "Mail Directory" update
pushbutton 6 45 57 15 "File Directory" update
pushbutton 6 65 57 15 "Log Directory" update
pushbutton 70 90 60 15 "Finished" normal default
vtext 66 8 130 12 left Cfg7
vtext 66 28 130 12 left Cfg8
vtext 66 48 130 12 left Cfg9
vtext 66 68 130 12 left Cfg10
enddialog
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10
exitwhile
endcase
case 30
sdlginput "Editor Filename Request" "Input complete Path:" Cfg7 DEFAULT
updatedlg 64
endcase
case 31
sdlginput "Mail Directory Request" "Input complete Path:" Cfg8 DEFAULT
updatedlg 64
endcase
case 32
sdlginput "File Directory Request" "Input complete Path:" Cfg9 DEFAULT
updatedlg 64
endcase
case 33
sdlginput "Capture log Directory Request" "Input complete Path:" Cfg10 DEFAULT
updatedlg 64
endcase
endswitch
endwhile
ENDPROC ;DirConfig
PROC OptConfig
dialogbox 130 70 100 125 2 "OPTION INFORMATION"
checkbox 15 5 80 12 "Show Program Info" Cfg11
checkbox 15 20 80 12 "Delete Mail" Cfg12
checkbox 15 35 80 12 "Confirm Dialing" Cfg13
checkbox 15 50 80 12 "Command mode" Cfg14
checkbox 15 65 80 12 "Confirm Mail Pickup" Cfg15
checkbox 15 80 80 12 "Suspend Dialing" Cfg16
pushbutton 20 100 60 15 "Finished" normal default
enddialog
choice=$DIALOG
while choice != 1
choice=$DIALOG
switch choice
case 10
exitwhile
endcase
endswitch
endwhile
ENDPROC ;OptConfig
PROC ReadCfg
fopen 0 "AUTOCIS.CFG" READ ; opens configuration file for read only
for I7=1 UPTO 16
fgets 0 Name
strlen Name I6
dec I6
dec I6
switch I7
case 1
SUBSTR Cfg1 Name 0 I6
endcase
case 2
SUBSTR Cfg2 Name 0 I6
endcase
case 3
SUBSTR Cfg3 Name 0 I6
endcase
case 4
SUBSTR Cfg4 Name 0 I6
endcase
case 5
SUBSTR Cfg5 Name 0 I6
endcase
case 6
SUBSTR Cfg6 Name 0 I6
endcase
case 7
SUBSTR Cfg7 Name 0 I6
endcase
case 8
SUBSTR Cfg8 Name 0 I6
endcase
case 9
SUBSTR Cfg9 Name 0 I6
endcase
case 10
SUBSTR Cfg10 Name 0 I6
endcase
case 11
SUBSTR TempS Name 0 I6
ATOI TempS Cfg11
endcase
case 12
SUBSTR TempS Name 0 I6
ATOI TempS Cfg12
endcase
case 13
SUBSTR TempS Name 0 I6
ATOI TempS Cfg13
endcase
case 14
SUBSTR TempS Name 0 I6
ATOI TempS Cfg14
endcase
case 15
SUBSTR TempS Name 0 I6
ATOI TempS Cfg15
endcase
case 16
SUBSTR TempS Name 0 I6
ATOI TempS Cfg16
endcase
endswitch
endfor
fclose 0
ENDPROC ;ReadCfg
PROC SaveCfg
isfile "AUTOCIS.CFG"
if success
fopen 0 "AUTOCIS.CFG" WRITE
else
fopen 0 "AUTOCIS.CFG" CREATE
endif
strlen Cfg1 I8
fwrite 0 Cfg1 I8
fputc 0 13
fputc 0 10
strlen Cfg2 I8
fwrite 0 Cfg2 I8
fputc 0 13
fputc 0 10
strlen Cfg3 I8
fwrite 0 Cfg3 I8
fputc 0 13
fputc 0 10
strlen Cfg4 I8
fwrite 0 Cfg4 I8
fputc 0 13
fputc 0 10
strlen Cfg5 I8
fwrite 0 Cfg5 I8
fputc 0 13
fputc 0 10
strlen Cfg6 I8
fwrite 0 Cfg6 I8
fputc 0 13
fputc 0 10
strlen Cfg7 I8
fwrite 0 Cfg7 I8
fputc 0 13
fputc 0 10
strlen Cfg8 I8
fwrite 0 Cfg8 I8
fputc 0 13
fputc 0 10
strlen Cfg9 I8
fwrite 0 Cfg9 I8
fputc 0 13
fputc 0 10
strlen Cfg10 I8
fwrite 0 Cfg10 I8
fputc 0 13
fputc 0 10
ITOA Cfg11 TempS
fwrite 0 TempS 1
fputc 0 13
fputc 0 10
ITOA Cfg12 TempS
fwrite 0 TempS 1
fputc 0 13
fputc 0 10
ITOA Cfg13 TempS
fwrite 0 TempS 1
fputc 0 13
fputc 0 10
ITOA Cfg14 TempS
fwrite 0 TempS 1
fputc 0 13
fputc 0 10
ITOA Cfg15 TempS
fwrite 0 TempS 1
fputc 0 13
fputc 0 10
ITOA Cfg16 TempS
fwrite 0 TempS 1
fputc 0 13
fputc 0 10
fclose 0
ENDPROC ;SaveCfg
PROC ProgInfo
dialogbox 110 70 140 125 2 "PROGRAM INFORMATION"
text 10 8 120 8 center "Procomm for Windows V1.xx script"
text 15 25 110 8 center "A U T O C I S"
text 15 32 110 4 center "~~~~~~~~~~"
text 15 38 110 8 center "Version 1.00"
text 15 54 110 8 center "Released 5 November 1992"
text 15 64 110 8 center "Written by Ralph Deitrick"
text 15 74 110 8 center "CompuServe UID 76547,3434"
text 15 88 110 8 center "PLEASE read AUTOCIS.DOC"
pushbutton 50 102 40 15 "OK" normal default
enddialog
choice=$DIALOG
while choice != 1
choice=$DIALOG
if eq choice 10
exitwhile
endif
endwhile
ENDPROC ;ProgInfo
; ------------------------------------------
; | PROCEDURES FOR INVOKING EDITOR |
; ------------------------------------------
PROC DoEdit
Call ShoDirBox
while choice != 1
choice=$DIALOG
switch choice
case 10
Name=Cfg7
strcat Name " "
strcat Name UseFile
run Name MAXIMIZED
Call ShoDirBox
endcase
case 11
TempS=UseFile
sdlginput "RENAME INPUT REQUEST" "Input new Path\filename:" TempS DEFAULT
rename UseFile TempS
Call ShoDirBox
endcase
case 12
TempS="Are you sure you want to delete "
strcat TempS UseFile
strcat TempS " ?"
sdlgmsgbox "DELETION CONFIRMATION" TempS STOP YESNO I7
if eq I7 6
delfile UseFile
if not success
errormsg "Can't delete %s !" UseFile
endif
elseif eq I7 7
usermsg "File deletion canceled !"
endif
Call ShoDirBox
endcase
case 13
TempS=Usefile
sdlginput "COPY FILE DESTINATION" "Input new Path\filename:" TempS DEFAULT
strcmp TempS UseFile
if success
errormsg "File can not be copied unto itself !"
else
copyfile UseFile TempS
if not success
errormsg "File copy not successful !"
endif
endif
Call ShoDirBox
endcase
case 14
sdlginput "DIRECTORY REQUEST" "Input COMPLETE Directory Path:" DirName DEFAULT
Call ShoDirBox
endcase
case 15
exitwhile
endcase
endswitch
endwhile
ENDPROC ;DoEdit
PROC ShoDirBox
dialogbox 115 50 130 130 2 "DOCUMENT REVIEWER"
dirlistbox 68 16 56 110 DirName single UseFile
vtext 5 4 123 9 left DirName
pushbutton 7 16 50 14 "Write/Edit" normal default
pushbutton 7 34 50 14 "Rename File" normal
pushbutton 7 52 50 14 "Delete File" normal
pushbutton 7 70 50 14 "Copy File" normal
pushbutton 7 88 50 14 "Change Dir" normal
pushbutton 7 106 50 14 "Finished" normal
enddialog
ENDPROC ;ShoDirBox
; ****************************************************************************
; * *
; * OPERATIONS ON LINE WITH COMPUSERVE *
; * *
; ****************************************************************************
; ----------------------------------------------------------
; | PROCEDURES FOR MAIL OPERATIONS ON COMPUSERVE |
; ----------------------------------------------------------
PROC MailRun ; need to catch "no mail waiting"
if Tour >= 2
strcmp TempS Order1
if success
pause 1
goto DoMail
endif
endif
waitfor "Mail Main" 20
waitfor "no mail" 1 ; choice will occur during this waitfor
if success
MailWait=0 ; indicates no mail waiting (No)
else
MailWait=1 ; indicates there is mail waiting (Yes)
endif
waitfor "choice !" 1 ; likely occurs while waitfor "no mail"
count=0
if eq Cfg14 1 ; this indicates command mode
S0="Mail!" ; top menu
S2="Action!" ; action menu
S3="Send!" ; Send menu
transmit "SET MOD COM^M"
else
S0="Main Menu"
S2="<CR>"
S3="Send Menu" ; Send menu
transmit "SET MOD MEN^M"
endif
waitfor "choice !" 3 ; wait for end of Menu
DoMail:
substr TempS Order3 0 6
switch TempS
case "Send T"
Call SendText
endcase
case "Send F"
Call FileSend
endcase
case "Get Ma"
if eq MailWait 1
Call GetMail
else
MailRecd=0
endif
endcase
endswitch
ENDPROC ;MailRun
PROC SendText ; sends ASCII Mail files
transmit "SET EDI NOL^M"
WAITFOR "choice !" 3
when Target 1 S2 Call TransCR ; this is press <CR>
when Target 2 S0 Call ClrFlag ; this is Mail! & sets Flag=0
Flag=1
Name = MailDir
strcat Name "\LETTERS.OUT"
SendFile ASCII Name
while flag ; waiting for Mail! prompt
endwhile
fopen 0 Name READWRITE TEXT
while not FEOF 0
fgets 0 Char
strcmp Char "/SEND" 5
if success
inc Count
endif
endwhile
TempS = " ***** SENT @ "
strcat TempS $time
strcat TempS " on "
strcat TempS $date
strcat TempS " *****"
fwrite 0 TempS 54
fclose 0
clearwhen Target 1
clearwhen Target 2
add MailSent Count MailSent
ENDPROC ;SendText
PROC FileSend ; uploads Binary mail files
DesFile=FileDir
STRCAT DesFile "\FileUPL.MAI"
FOPEN 0 DesFile READ TEXT
StartBin:
Call GetParam
WordS=TempS ; save type of file, ASC or BIN
strcmp TempS "END" 3
if success
goto EndBinMail
endif
transmit "UPL/PRO:B/TYP:"
transmit TempS ; this is ASC or BIN
transmit "^M"
waitfor "computer:" 10
Name=MailDir
strcat Name "\"
Call GetParam
strcat Name TempS
transmit Name
transmit "^M"
waitfor "" 5 ; wait for enquiry
pause 1
set terminal enquiry CISB
Call DoTransfer
set terminal enquiry OFF
if eq Item 3
goto EndBinMail
endif
strcmp WordS "BIN" ; this was saved above
if success
Call GetParam
transmit TempS ; this is addressee of BIN file
transmit "^M"
waitfor "Subject:" 5
Call GetParam
transmit TempS ; this is subject of BIN file
transmit "^M"
endif
waitfor "(Y or N)" 3
pause 1
transmit "Y^M" ; confirms addressee and subject
if eq KeepOn 1
goto StartBin ; return to send next file
endif
EndBinMail:
ADD MailSent count MailSent ; Count is limited to 9 maximum
ENDPROC ;FileSend
PROC GetMail
transmit "SET PAG NO^M" ; set paging off
waitfor "choice !" ; wait for end of Menu
Count=0
BinCnt=0
Item=0
clearwhen Target 0
when Target 0 "age is B" Call GetBin ; this is "Message is Binary"
when target 1 S0 Call Terminate ; this is "Mail!"
when Target 2 S2 Call MailDispose ; this is Action! or press <CR>
transmit "REA ALL" ; request read all mail
Flag=1
transmit "^M"
while Flag
endwhile
clearwhen Target 0
clearwhen Target 1
clearwhen Target 2
when Target 0 "% Invalid" CALL GoManual ; protection against "bad" commands
add MailRecd count MailRecd ; total of mail received
ENDPROC ;GetMail
PROC GetBin
clearwhen Target 2
Call MailDL
Call MailDispose
when Target 2 S2 Call MailDispose ; this is Action! or press <CR>
ENDPROC ;GetBin
PROC MailDispose
pause 1
if eq Cfg14 0 ; this indicates menu mode
transmit "^M" ; answer to press <CR>
mspause 500 ; wait for action menu
endif
switch Cfg12
case 0 ; means don't delete mail
transmit "SAV"
endcase
case 1 ; means delete mail after retrieval
if eq Item 3 ; this is download failure
Item=0
transmit "SAV"
else
transmit "DEL"
endif
endcase
endswitch
inc Count ; account for another letter received
transmit "^M" ; deletes or saves mail
ENDPROC ;MailDispose
PROC MailDL
INC BinCnt
Name="BINLTR"
ITOA BinCnt Char
strcat Name Char
set autodnld ON
set terminal enquiry CISB ; set for automatic cisb download
Flag=1
I6=0
transmit "DOW/PRO:B^M" ; download with CompuServe B Protocol
; try to recover Binary filename
while Flag ; loop checking for filename
rget TempS 60 ; get 60 characters of received data
if eq I6 0 ; provides check until filename found
strfind TempS "." I7 ; period between filename & extension
if found
sub I7 8 I8 ; allow for 8 character filename
dec I7 ; move to left of decimal
for I6=I7 downto I8 ; check backward for 8 characters
strpeek TempS I6 I9
if ge I9 48 ; this is zero
if le I9 57 ; this is 9
loopfor ; continues if character is a number
endif
endif
if le I9 64 ; stops for space, slash, colon, etc.
sub I7 I6 I7 ; number of characters in filename
add I7 4 I7 ; add for decimal and extension
Inc I6 ; move right to first letter
substr Name TempS I6 I7 ; get filename plus extension
exitwhile ; go to download once filename is found
endif
endfor
I6=1 ; eliminates this check once filename
endif ; is found
endif
strfind TempS "ter:" ; "your computer:" prompt
if found
goto DoDL ; loop exit once prompt appears
endif
endwhile
waitfor "computer:"
; perform the actual download
DoDL:
transmit MailDir
transmit "\"
transmit Name
transmit "^M"
Call DoTransfer
if eq Item 2
dec Count
endif
set autodnld OFF
set terminal enquiry OFF ; turn off enquiry response
ENDPROC ;MailDL
; -----------------------------------------------------------
; | PROCEDURES FOR FORUM OPERATIONS ON COMPUSERVE |
; -----------------------------------------------------------
PROC ForumRun
when target 1 "waiting" Call GetWaiting
Count=0
if Tour >= 2
strcmp TempS Order1
if success
clearwhen Target 1 ; no need for "waiting" if still in Forum
goto DoTask
endif
endif
if eq Cfg13 1
S1="Messages !"
S2="Forum !"
S3="ages !"
S4=" !"
else
S1="choice !"
S2="choice !"
S3="choice !"
S4=" !"
endif
; check for messages waiting upon entering Forum
waitfor "Welcome" 60 ; entrance to Forum - may take a long
waitfor "<CR> !" 15 ; time if SysOp messages
; if waiting, read will occur here
if eq Cfg13 1 ; this means command mode
transmit "OPT;MOD COM;PAU NEV;S^M" ; sent to ans "Press <CR> !"
else
transmit "OPT;MOD MEN;PAU NEV;S^M" ; sent to ans "Press <CR> !"
endif
waitfor S2 5 ; signifies end of Forum Menu
clearwhen Target 1 ; no need for "waiting" prompt any more
; now check to see if joining the Forum is desired
strlen Order1 I8
sub I8 7 I6
substr WordS Order1 7 I6 ; WordS is Area name (i.e. DSTORM)
strcmp Join WordS ; is joining necessary ?
if success ; yes, joining is desired
transmit "Join" ; indicate selection is JOIN
waitfor "Name:" 5
transmit Cfg9 ; send your name
transmit "^M"
waitfor "correct" 2
transmit "Y^M" ; confirm correctness
pause 2
transmit "^M"
waitfor S2 5 ; signifies end of Forum Menu
Join="" ; clear the join request
endif
; now perform desired task
DoTask:
substr TempS Order2 0 3
switch TempS
case "mes"
transmit "MES^M" ; go to Message Menu
waitfor S3 5
substr TempS Order3 0 3
switch TempS
case "DEL"
transmit Order3
transmit Order4
transmit "^M"
waitfor "N)?"
transmit "Y^M"
endcase
case "REA"
Count=0
when target 2 "#: " Call ChgCount
pause 1
transmit Order3 ; this is REA ???
strcmp Order4 $NULLSTR
if not success
transmit Order4 ; this is message number
endif
Char=S3
Call CheckEnd ; includes TRANSMIT "^M"
clearwhen Target 2
add MesgRecd Count MesgRecd
goto ForRunOut
endcase
case "ROO"
transmit "OPT;PAU ALW;S^M" ; indicate to pause after message
waitfor S2 5
transmit "REA NUM:" ; read message
transmit Order4 ; number for which to find root
transmit "^M"
waitfor "Action" 20
transmit "ROO^M"
waitfor "#: " 10 ; wait for start of Root message number
rget TempS 6 ; get Root message number - 6 digits
waitfor "Action" 20
transmit "B^M" ; return to Read Menu
waitfor S1 20 ; waiting for end of Read Menu
transmit "OPT;PAU NEV;S^M"
waitfor S1 20 ; waiting for end of Read Menu
Count=0
when target 2 "#: " CALL ChgCount
transmit "REA THR NUM:"
transmit TempS ; this is Root message of thread
Char=S3
Call CheckEnd ; includes TRANSMIT "^M"
clearwhen Target 2
add MesgRecd Count MesgRecd
goto ForRunOut
endcase
case "Sen"
Count=0
transmit "OPT;EDI EDI;S^M"
waitfor S1 15 ; at end of Messages menu
TempS=LogDir
strcat TempS "\MESSAGES."
substr Char Order1 7 3
strcat TempS Char
pause 1
sendfile ASCII TempS
while $TXCOUNT
endwhile
waitfor S1
fopen 0 TempS READWRITE TEXT
while not feof 0
fgets 0 Char
strcmp Char "/POST" 5
if success
Call ChgCount
endif
endwhile
fwrite 0 " ********** SENT **********" 38
fclose 0
add MesgSent Count MesgSent
goto ForRunOut
endcase
endswitch
endcase
case "lib"
transmit "SET PAG NO;LIB 1^M"
; determine title of Lib 1
comgets WordS 40 2
strlen WordS I8
sub I8 10 I7
substr SaveS WordS I7 8
substr TempS Order3 0 3
switch TempS
case "DOW"
Call DnLoad
goto ForRunOut ; and leave CompuServe
endcase
case "UPL"
Call UpLoad
goto ForRunOut ; and leave CompuServe
endcase
case "BRO"
transmit Order3
transmit Order4 ; Lib numbers to cover
transmit "^M"
Order3="Manual mode"
Call ExitWait
goto ForRunOut ; and leave CompuServe
endcase
case "Man"
Call ExitWait
goto ForRunOut
endcase
default
transmit "SET PAGE OFF^M"
waitfor S4 5 ; this is " !"
transmit Order3 ; defines how many days to go back
transmit Order4 ; Lib numbers to cover & keywords
Char = SaveS ; SaveS defined at entrance to Lib 1
Call CheckEnd ; includes TRANSMIT "^M"
goto ForRunOut ; and leave CompuServe
endcase
endswitch
endcase
endswitch
ForRunOut:
ENDPROC ;ForumRun
PROC GetWaiting
when target 2 "#: " Call ChgCount
if eq Cfg13 1
transmit "OPT;MOD COM;S^M" ; this is sent in ans to "Press <CR> !"
else
transmit "OPT;MOD MEN;S^M" ; this is sent in ans to "Press <CR> !"
endif
waitfor S2 2 ; signifies return from Options
transmit "MES;REA WAIT;S" ; returns to Messages Menu
Char=S3 ; signifies end of Messages Menu
Call CheckEnd ; includes TRANSMIT "^M"
transmit "B^M" ; back up to Forum Menu
waitfor S2 ; signifies end of Forum Menu
clearwhen Target 1
clearwhen Target 2
add MesgRecd Count MesgRecd
ENDPROC ;GetWaiting
PROC ChgCount
inc Count
ENDPROC ;ChgCount
; --------------------------------------------------------------
; | PROCEDURES FOR ZIFF Net OPERATIONS ON COMPUSERVE |
; --------------------------------------------------------------
PROC SoftRun
Count=0
waitfor "Library" 60 ; may take long time entering Ziff Net
strcmp Order2 "4" ; this is download a utility
if success
DesFile=FileDir
strcat DesFile "\FileDOW.SOF"
fopen 0 DesFile READ TEXT
Call GetParam ; get filename if it's a download
endif
DoSoftGo:
waitfor "choice !" 3
transmit Order2
transmit "^M"
strcmp Order4 "Manual mode"
if success
Call ExitWait
goto DoSoftOut
endif
switch Order2
case "3" ; search
waitfor ":" 1
transmit Order3 ; this is type of search
transmit "^M"
WAITFOR "choice" 1
when target 1 "more !" Call TransCR
when target 2 "Last page" CALL ClrFlag ; sets Flag to zero
Flag=1
transmit Order4 ; this is keyword, file name, etc.
transmit "^M"
while Flag
endwhile
clearwhen target 1
clearwhen target 2
endcase
case "4" ; download file(s)
waitfor ") :" 10
transmit TempS
transmit "^M"
waitfor "(Y/N):" 10
transmit "Y^M"
waitfor "minutes" 3
transmit "^M"
waitfor "choice !" 3
transmit "2^M"
MSPAUSE 500
GETFILE CISB
waitfor "page !" 15
inc Count
Call GetParam
strcmp TempS "END" 3 ; check for end of data
if not success
transmit Order1 ; this returns to initial menu
transmit "^M"
GOTO DoSoftGo
endif
fclose 0
add FileRecd Count FileRecd
endcase
default ; about library & instructions
when target 1 "more !" Call TransCR
when target 2 "Last page !" Call ClrFlag
Flag=1
while Flag
endwhile
clearwhen Target 1
clearwhen Target 2
endcase
endswitch
DoSoftOut:
ENDPROC ;SoftRun
; ------------------------------------
; | FILE TRANSFER PROCEDURES |
; ------------------------------------
PROC DnLoad
Count=0 ; S4=" !" has occurred
DesFile=FileDir
strcat DesFile "\FileDOW."
substr TempS Order1 7 3 ; get first 3 letters of Forum name
strcat DesFile TempS
fopen 0 DesFile READ TEXT
StartDL:
WordS = "LIB "
Call GetParam
strcmp TempS "END" 3 ; check for end of data
if success
goto EndDL
endif
strcat WordS TempS ; WordS now is "LIB #"
transmit WordS ; indicate which Lib to go to
transmit "^M"
waitfor " !" 5 ; have to wait for next menu
transmit "DOW PRO:B "
Call GetParam
strcmp TempS "END" 3 ; check for end of data
if success
goto EndDL
endif
Name = TempS
transmit Name
transmit "^M"
; see if file exists
waitfor "Not found" 5
if success
goto StartDL
else
; perform the actual download ; next prompt would be "computer:"
set autodnld ON
set terminal enquiry CISB ; set for automatic cisb download
transmit FileDir ; download directory
transmit "\"
transmit Name ; use same filename as source
transmit "^M" ; send it
Call DoTransfer
set autodnld OFF
set terminal enquiry OFF ; set for automatic download off
endif
waitfor " !" 3
goto StartDL
EndDL:
add FileRecd Count FileRecd
ENDPROC ;DnLoad
PROC UpLoad
Count = 0
DesFile=FileDir
strcat DesFile "\FileUPL."
substr TempS Order1 7 3 ; get first 3 letters of Forum name
strcat DesFile TempS
fopen 0 DesFile READ TEXT
StartUL:
pause 1
WordS = "LIB "
Call GetParam ; returns data in TempS
strcmp TempS "END" 3 ; check for end of data
if success
goto EndUL
endif
strcat WordS TempS ; WordS now is "LIB #"
transmit WordS ; indicate which Lib to go to
transmit "^M"
waitfor "!" 15
Call GetParam
strcmp TempS "END" ; check for end of data
if success
goto EndUL
endif
transmit "UPL PRO:B TYPE:" ; request Upload using CIS B+ protocol
transmit TempS ; this is ASC, BIN, etc
transmit "^M"
waitfor "name:" 15
Call GetParam
Name=TempS ; this is filename
transmit Name ; send filename for CIS
transmit "^M" ; finalize UPL or Protocol command
DoUL:
waitfor "computer:" 5
set terminal enquiry CISB ; set for automatic upload on
if success
clearwhen Target 0 ; to avoid "%" about file already exists
transmit FileDir ; send directory for your computer
transmit "\"
transmit Name ; send filename for your computer
transmit "^M"
else ; in case "Replace it" is prompt
transmit "Y^M" ; indicate replacement is desired
goto DoUL
endif
waitfor "" 5
while $FILEXFER == 0
endwhile
Call DoTransfer
set terminal enquiry OFF
if eq Item 3
goto FinUL
endif
waitfor "Description" 10
while 1
for I6 = 1 upto 8
Call GetParam
transmit TempS
strcmp TempS "/EXIT" 5
if success
exitwhile
else
transmit "^M"
endif
endfor
endwhile
transmit "^M"
waitfor "Keywords" 10
pause 2
while 1
Call GetParam
strcmp TempS "OK"
if not success ; if original or replacement
transmit TempS
endif
transmit "^M" ; sends keyword or says none needed
exitwhile
endwhile
waitfor "Title" 10
pause 2
while 1
Call GetParam
strcmp TempS "OK"
if not success ; if original or replacement
transmit TempS
endif
transmit "^M" ; sends title or says none needed
exitwhile
endwhile
waitfor "(Y or N)?" 10
transmit "Y^M" ; indicates correct
waitfor "Press <CR>" 3
transmit "^M"
pause 1
FinUL:
when Target 0 "% Invalid" CALL GoManual ; reactivate non MNP safeguard
if eq KeepOn 1 ; if multiple files
goto StartUL ; return to send next file
endif
EndUL:
fclose 0
add FileSent Count FileSent
ENDPROC ;UpLoad
PROC GetParam
FGETS 0 Char
STRLEN Char I8
SUBSTR TempS Char 0 I8
ENDPROC ;GetParam
PROC DoTransfer
Item=$FILEXFER
while Item < 2
Item=$FILEXFER
endwhile
pause 2
switch Item
case 2
inc Count
endcase
case 3
dialogbox 200 70 120 18 14 "FILE TRANSFER STATUS"
text 10 4 100 10 center "FILE TRANSFER FAILURE !"
enddialog
alarm 1 ; alarm for failed download
pause 2
destroydlg
endcase
endswitch
ENDPROC ;DoTransfer
PROC TransCR
transmit "^M"
ENDPROC ;TransCR
; ----------------------------------------------
; | PROCEDURES FOR ENTERING COMPUSERVE |
; ----------------------------------------------
PROC LogOn
Long Rate ; define Rate as Long number
while $TXCOUNT ; characters remaining to transmit
endwhile
Call DefineLog ; define capture log name
set capture path Cfg10
set capture file LogName
set capture mode append FILTERED
set capture query off ; DO NOT prompt for filename
if $FROMDDIR
Call StartLog ; write header in capture log
capture ON ; open file LogName
goto AfterDial
endif
set terminal type 5
set terminal stripbit8 ON ; strip the eighth bit
set protocol CISB
set port parity NONE
set port databits 8
set port stopbits 1
set port duplex FULL
set port dropdtr YES
; convert Baud rate string to long number
strlen Cfg4 I8
sub I8 2 I8
strcpy TempS Cfg4 I8
ATOI TempS I6
Rate=I6
mul Rate 100 Rate
set baudrate Rate ; Configure line settings
if eq Cfg16 1 ; request for delayed dialing
Call Delay
if Flag
goto End
endif
endif
I6=5 ; number of redial attempts
Retry:
time S8 ; Store current time in S8
date S9 ; Store current date in S9
strfmt TempS " Dialing CompuServe at %s on %s from terminal" S8 S9
pwtitlebar TempS
Call StartLog ; write header in capture log
; dial the number
txflush
pause 1
Flag=0
when target 1 "NO CARRIER" call SetFlag ; sets Flag = 1
transmit "ATDT " ; dial the number
transmit Cfg1
transmit "^M^J" ; carriage return and line feed
while $DIALING
endwhile
pause 8 ; needed to wait for answer
if eq Flag 1
goto badlogon
endif
capture ON ; open file LogName
; confirm Reliable connection
strcmp Cfg5 $NULLSTR ; if no error conformation expected
if success ;(non error-correcting modem or no Cfg5)
while ! $CARRIER
endwhile
alarm 2 ; sound when carrier achieved
goto AfterDial
else
when target 1 Cfg5 call SetFlag ; sets Flag = 1
when target 2 "NONE" call ChgFlag ; sets Flag = 2
Flag=0
Count=0
while not flag
pause 1
inc Count
if eq Count 35
Flag=2 ; means time out
exitwhile
endif
endwhile
clearwhen Target 1
clearwhen Target 2
if eq Flag 2 ; means either time out or no Protocol
goto badlogon
endif
alarm 2 ; indicate successful connection
endif
AfterDial: ; come here from dialing directory
if $CARRIER
KeepOn = 1
else
goto badlogon
endif
; script for logging onto CIS
while $CARRIER
transmit "^M" ; initiate logging on CIS
waitfor "Host Name:"
if success
transmit "CIS^M"
else
goto badlogon
endif
waitfor "User ID:"
if success
transmit Cfg2
transmit "^M"
else
goto badlogon
endif
waitfor "Password:"
if success
transmit Cfg3 ; send password, transmit "^M" is below
else
goto badlogon
endif
L1=$ltime ; Start time for lapsed time calculation
set terminal stripbit8 OFF ; stop striping the eighth bit
when Target 0 "% Invalid" CALL GoManual ; protection against "bad" commands
when cdchanges CALL LostCD
when Target 2 "Mail wait" CALL PickUpMail ; to catch mail waiting message
transmit "^M" ; Send <CR> for Password transmission
waitfor "Reserved" 60 ; end of CompuServe banner
pwtitlebar "On line to CompuServe"
waitfor "Enter choice" 10 ; choice request at end of Top Menu
; mail pickup will occur here ----
clearwhen Target 2 ; no more chance for mail message-close
goto End
endwhile
BadLogon:
hangup
capture OFF
KeepOn = 0
while I6 > 0 ; for count variable positive,
dec I6 ; decrement the counter and
pwtitlebar "Pausing before redialing"
pause 15 ; wait 10 seconds before redial before
goto Retry ; going back to redial
endwhile
set terminal stripbit8 OFF ; stop striping the eighth bit
pwtitlebar CISTitle
UserMsg "Log on aborted"
End:
ENDPROC ;LogOn
PROC ClrFlag
Flag=0
ENDPROC ;ClrFlag
PROC SetFlag
Flag=1
ENDPROC ;SetFlag
PROC ChgFlag
Flag=2
ENDPROC ;ChgFlag
PROC DefineLog
Date Today
SubStr Month Today 0 2
SubStr Day Today 3 2
LogName="CIS_"
StrCat LogName Month 2
StrCat logName Day 2
StrCat LogName ".CAP" 4
ENDPROC ;DefineLog
PROC StartLog
LogLoc=LogDir
strcat LogLoc "\"
strcat LogLoc LogName
IsFile LogLoc
If Success
FOpen 1 LogLoc WRITE TEXT ; open Capture Log for appending
FSeek 1 0 2
Else
FOpen 1 LogLoc CREATE TEXT ; open Capture Log for first write
EndIf
Fputc 1 10 ; sends line feed to file
TempS=">>>> CISPlus Capture Log Opened on "
StrCat TempS $Date
StrCat TempS " at "
StrCat TempS $Time
StrCat TempS " <<<<"
fputs 1 TempS
FClose 1 ; close Capture Log after heading write
ENDPROC ;StartLog
PROC Delay
sdlginput "SUSPEND TIME DEFINITION" "Enter military time in HH:MM format:" TempS
strfmt WordS "DIALING WILL BEGIN AT %s" TempS
dialogbox 115 90 130 45 14 "SUSPENDED DIALING"
vtext 10 4 110 8 center WordS
pushbutton 10 20 50 15 "Immediate" normal default
pushbutton 70 20 50 15 "Cancel" normal
enddialog
Flag = 1
while Flag
S1=$TIME24 ; continually get current Military time
strcmp S1 TempS 5 ; compare current HH:MM to suspend time
if success ; when they are the same
Flag = 0 ; exit the WHILE
exitwhile
endif
choice=$DIALOG
switch choice
case 10
Flag = 0 ; exit the WHILE
exitwhile
endcase
case 11
exitwhile ; leaves Flag = 1
endcase
endswitch
endwhile
destroydlg
ENDPROC ;Delay
PROC PickUpMail
clearwhen Target 2 ; close WHEN before "Mail" occurs again
strcmp Order1 "GO CIS:MAIL"
if success
strcmp Order3 "Get Mail"
if success
goto PickUpEnd
endif
endif
if eq Cfg15 1 ; indicates confirm mail pickup
sdlgmsgbox "AUTOMATIC MAIL PICKUP" "MAIL WAITING !,Download Mail Now ?" \
QUESTION YESNO choice BEEP
if eq choice 7 ; this is No (6 is Yes)
goto PickUpEnd
endif
endif
SaveS=Order3
Order3="Get Mail"
transmit "GO CIS:MAIL^M"
Call MailRun
Order3=SaveS
SaveS=$NULLSTR
PickUpEnd:
ENDPROC ;PickUpMail
; ---------------------------------------------
; | PROCEDURES FOR LEAVING COMPUSERVE |
; ---------------------------------------------
PROC CheckEnd ; suggested by Markus Pope of DATASTORM
Flag=1
when TARGET 1 Char CALL Terminate ; WHEN 2 is counting messages
transmit "^M"
while Flag
if eq KeepOn 0
exitwhile
endif
endwhile
clearwhen Target 1
ENDPROC ;CheckEnd
PROC Terminate
Flag=0
ENDPROC ;Terminate
PROC LostCD
dialogbox 250 150 70 18 14 "CD INTERRUPT"
text 10 4 50 8 center "Carrier lost"
enddialog
for I6=1 upto 5
if $CARRIER
goto LostCDOut
endif
mspause 500
endfor
KeepOn = 0
Call ExitCIS
LostCDOut:
destroydlg
ENDPROC ;LostCD
PROC GoManual
sdlgmsgbox "INVALID COMMAND PROBLEM" "Enter Commands Manually" EXCLAMATION OK choice
CALL ExitWait ; wait for LOG command
ENDPROC ;GoManual
PROC LogOff
waitfor "!" 2
transmit "LOG^M"
Call ExitWait
ENDPROC ;LogOff
PROC ExitWait
waitfor "User ID:" FOREVER
Call ExitCIS
ENDPROC ;ExitWait
PROC ExitCIS
clearwhen Target 0
clearwhen Target 1
clearwhen Target 2
clearwhen cdchanges ; discontinue check for disconnect
pause 1 ; wait for completion of hang up
if $CARRIER
hangup ; then hang up the modem
endif
pause 1 ; wait for completion of hang up
Capture OFF ; and close the log
KeepOn = 0
Call Lapsed
FOpen 1 LogLoc WRITE TEXT ; open Capture Log for appending
FSeek 1 0 2 ; locate end of file
FStrFmt 1 "%cTotal CompuServe connect time was %s%c*****%c" 10 ETime 10 10
FClose 1
ENDPROC ;ExitCIS
PROC Lapsed
Long Final
Integer Delta, eminsub, ehours, eminutes, eseconds
String fhours, fminutes, fseconds
Final = $ltime ; Here starts the loop which calculates
Delta = Final - L1 ; total elapsed seconds
div Delta 3600 ehours ; convert on-line time back
mod Delta 3600 eminsub ; to hrs. min. secs.
div eminsub 60 eminutes ; (Divide total by 3600 for
mod eminsub 60 eseconds ; hours; get REMAINDER;
itoa ehours fhours ; divide remainder by 60
itoa eminutes fminutes ; to get minutes, etc.)
itoa eseconds fseconds ; Integers back to strings
strfmt ETime " %s:%02s:%02s " fhours fminutes fseconds ; Final display param
ENDPROC ;Lapsed
; ======================== END OF SCRIPT ===========================